// pages/index/index.js
var utils = require('../../utils/util.js');
Page({

    /**
     * 页面的初始数据
     */
    data: {
        banner: [],
        tabs: [],
        current: 0,
		tab4:[
			{url:"",txt:"生日祝福",img:"/images/tab4-1.jpg"},
			{ url: "", txt: "表白求婚", img: "/images/tab4-2.jpg" },
			{ url: "", txt: "开业商务", img: "/images/tab4-3.jpg" },
			{ url: "", txt: "周年纪念", img: "/images/tab4-4.jpg" }
			],
		recommend:[
			{title:"浪漫生日礼",intro:"让她心跳加速·铭记心动时刻",img:"/images/banner.jpg"},
			{ title: "鲜花热销榜", intro: "万众宠爱一定是有原因的", img: "/images/banner1.jpg" },
			{ title: "特价专区", intro: "懂得持家也要懂得浪漫", img: "/images/banner.jpg" },
		],
		bottom:[
			{img:"/images/bottom1.jpg",p:"获评鲜花龙头企业"},
			{ img: "/images/bottom2.jpg", p: "1~3小时送花上门" },
			{ img: "/images/bottom3.jpg", p: "赛事冠军花艺师团队" },
			{ img: "/images/bottom4.jpg", p: "严选花材" },
			{ img: "/images/bottom5.jpg", p: "12道严苛品控标准" },
			{ img: "/images/bottom6.jpg", p: "500万用户信赖好评" }
		]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
this.getdata()
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },
    switchtab: function(e) {
        var index = e.currentTarget.dataset.index
        this.setData({
            current: index
        })
    },
    swiper: function(e) {
        var current = e.detail.current
        this.setData({
            current: current
        })
    },
	gopro:function(){
		wx.navigateTo({
			url: '/pages/product/index',
		})
	},
	getdata: function () {
		var that = this
		utils.GET({
			url: 'Index/asd',
			params: {},
			success: function (res) {
				console.log(res.data)
				that.setData({
					banner:res.data.b,
					tabs:res.data.m
				})
			},
		})
	}
})